//
//  RBGoodsConfirmPointsPopVC.m
//  zhongzhenglu
//
//  Created by XL on 2022/9/8.
//

#import "RBGoodsConfirmPointsPopVC.h"
#import "RBDefine.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"
#import <Masonry.h>
#import "RBThemeConfig.h"
#import <UIColor+YYAdd.h>
#import <UIView+YYAdd.h>
#import "RBPager.h"
#import "RanTool.h"

@interface RBGoodsConfirmPointsPopVC ()

@end

@implementation RBGoodsConfirmPointsPopVC

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
}

#pragma mark - Private

- (void)setup
{
    self.contentView = UIView.new;
    self.contentView.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:self.contentView];
    [self.contentView rbSetCorner:UIRectCornerTopLeft | UIRectCornerTopRight radius:Zoom(8)];
    
    [self.contentView view_addView:[RanTool labelWithFontSize:Zoom(13) weight:1 color:[RBThemeConfig textBlackColor] align:1 text:@"虚拟币抵扣"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(45) bottom:0 left:0 right:0 centerX:NO];
    
    UIImageView *closeBtn = [RanTool imgViewWithMode:0 radius:0 imgName:@"goodsDetailPramsClose"];
    [closeBtn extendResponseArea];
    [closeBtn rbAddTapGesWithTarget:self action:@selector(dismiss)];
    [self.contentView addSubview:closeBtn];
    [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(Zoom(18));
        make.top.mas_equalTo(Zoom(22));
        make.right.mas_equalTo(-Zoom(16));
    }];
    
    [self.contentView view_addView:({
        UIView *view = UIView.new;
        [view h_view_addView:[RanTool labelWithFontSize:Zoom(15) weight:0 color:[RBThemeConfig textBlackColor] align:0 text:@"虚拟币" bgColor:nil radius:0 borderWidth:0 borderColor:nil lines:1 linePadding:0 hPriority:1] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
        [view h_view_addView:[RanTool labelWithFontSize:Zoom(12) weight:0 color:[RBThemeConfig textGrayColor] align:0 text:@"440虚拟币，可抵扣4.4元。"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:Zoom(12) right:0 centerY:0];
        [view h_view_addView:[RanTool labelWithFontSize:Zoom(15) weight:0 color:[RBThemeConfig priceRedColor] align:0 text:@"- 4.40" bgColor:nil radius:0 borderWidth:0 borderColor:nil lines:1 linePadding:0 hPriority:2] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
        view;
    }) withHeight:Zoom(68) width:CGFLOAT_MIN top:Zoom(15) bottom:0 left:Zoom(21) right:Zoom(21) centerX:0];
    
    [self.contentView view_addView:({
        UIView *view = UIView.new;
        view.backgroundColor = [RBThemeConfig lineGrayColor];
        view;
    }) withHeight:1 width:CGFLOAT_MIN top:0 bottom:0 left:Zoom(17) right:Zoom(17) centerX:0];
    
    [self.contentView view_addView:({
        UIView *view = UIView.new;
        [view h_view_addView:[RanTool labelWithFontSize:Zoom(15) weight:0 color:[RBThemeConfig textBlackColor] align:0 text:@"不使用" bgColor:nil radius:0 borderWidth:0 borderColor:nil lines:1 linePadding:0 hPriority:1] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
        view;
    }) withHeight:Zoom(68) width:CGFLOAT_MIN top:0 bottom:MAX(kRBSafeBottomHeight, Zoom(20)) left:Zoom(21) right:Zoom(21) centerX:0];
    
    self.view.backgroundColor = UIColor.clearColor;
    self.contentView.width = kRBMainScreenWidth;
    self.contentView.height = self.contentView.esSize.height;
    self.contentView.left = 0;
    self.contentView.top = kRBMainScreenHeight;
}

- (void)show
{
    [UIView animateWithDuration:0.15 animations:^{
        self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
        self.contentView.bottom = kRBMainScreenHeight;
    }];
}

- (void)dismiss
{
    [UIView animateWithDuration:0.15 animations:^{
        self.view.backgroundColor = UIColor.clearColor;
        self.contentView.top = kRBMainScreenHeight;
    } completion:^(BOOL finished) {
        [self dismissViewControllerAnimated:NO completion:nil];
    }];
}


#pragma mark - Network

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

@end
